package tq.com.tqcom.base;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.scwang.smartrefresh.layout.SmartRefreshLayout;

import tq.com.tqcom.R;
import tq.com.tqcom.view.TQHeader5View;

public class BaseTitleRecycleFragment extends BaseFragment {
    protected RecyclerView mRecyclerView;
    protected TQHeader5View mHeader5View;
    protected SmartRefreshLayout mRefreshLayout;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return initView(inflater, container);
    }

    protected View initView(LayoutInflater pInflater, ViewGroup container){
        View lView = pInflater.inflate(R.layout.fragment_titlerecycle_layout, container,false);

        mRecyclerView = lView.findViewById(R.id.recycleView);
        mHeader5View = lView.findViewById(R.id.title);
        mRefreshLayout = lView.findViewById(R.id.refresh);

        initRecycleView(mRecyclerView);
        initHeader(mHeader5View);

        initRefresh(mRefreshLayout);
        return lView;
    }

    protected void initRecycleView(RecyclerView pRecyclerView){

    }
    protected void initHeader(TQHeader5View pHeader5View){

    }

    protected void initRefresh(SmartRefreshLayout pRefreshLayout){
        pRefreshLayout.setEnableLoadMore(false);
        pRefreshLayout.setEnableRefresh(false);
    }
}
